package tag31_22_08.coll;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;


public class Coll02_iterable {

	public static void main(String[] args) {

		Collection<Integer> collInt = new ArrayList<Integer>();
		
		for (int i = 0; i < 5; i++) {
			collInt.add(i); //Integer param = i; ---> Atoboxing
		}

		System.out.println(collInt.toString()); //[0, 1, 2, 3, 4]
		
		
		// for-each-schleife funktioniert mit Arrays 
		for (Integer value : collInt) {
			System.out.println(value);
		}
		
		
		System.out.println("---------------------------");
		for (int value : collInt) { //Autounboxing
			System.out.println(value);
		}
		
		//Para sacar la informacion
		System.out.println("-----------------------------");
		Iterator<Integer> iter = collInt.iterator();
		
	}

}
